Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not keep searching for recent #16424

Merged
merged 1 commit into from
Jul 17, 2019
Merged

Do not keep searching for recent #16424

merged 1 commit into from
Jul 17, 2019

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Jul 16, 2019

If userA has a lot of recent files. But only shares 1 file with userB
(that has no files at all). We could keep searching until we run out of
recent files for userA.

Now assume the inactive userB has 20 incomming shares like that from
different users. getRecent then basically keeps consuming huge amounts
of resources and with each iteration the load on the DB increases
(because of the offset).

This makes sure we do not get more than 3 times the limit we search for
or more than 5 queries.

This means we might miss some recent entries but we should fix that
separatly. This is just to make sure the load on the DB stays sane.

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

If userA has a lot of recent files. But only shares 1 file with userB
(that has no files at all). We could keep searching until we run out of
recent files for userA.

Now assume the inactive userB has 20 incomming shares like that from
different users. getRecent then basically keeps consuming huge amounts
of resources and with each iteration the load on the DB increases
(because of the offset).

This makes sure we do not get more than 3 times the limit we search for
or more than 5 queries.

This means we might miss some recent entries but we should fix that
separatly. This is just to make sure the load on the DB stays sane.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer added bug 3. to review Waiting for reviews labels Jul 16, 2019
@rullzer rullzer added this to the Nextcloud 17 milestone Jul 16, 2019
@kesselb
Copy link
Contributor

kesselb commented Jul 16, 2019

Cool 👍 I think we have already reports for this: #15995, #16020

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@MorrisJobke
Copy link
Member

/backport to stable16

@MorrisJobke
Copy link
Member

/backport to stable15

@MorrisJobke
Copy link
Member

/backport to stable14

@kesselb
Copy link
Contributor

kesselb commented Jul 16, 2019

We cannot backport this to stable15/stable14 but stable16 should be fine: #14185

@MorrisJobke
Copy link
Member

We cannot backport this to stable15/stable14 but stable16 should be fine: #14185

Why not? The PR was also back ported to 14 and 15.

@kesselb
Copy link
Contributor

kesselb commented Jul 16, 2019

Why not? The PR was also back ported to 14 and 15.

I missed that 🙈

@rullzer rullzer merged commit 4a52d93 into master Jul 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/do_not_keep_searching branch July 17, 2019 05:46
@backportbot-nextcloud
Copy link

backport to stable16 in #16432

@backportbot-nextcloud
Copy link

backport to stable15 in #16433

@backportbot-nextcloud
Copy link

backport to stable14 in #16434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants